package com.lanyou.cook.web.param;

import java.util.Collection;
import java.util.Objects;

import org.apache.commons.lang3.StringUtils;

public class TreeNode {

	private String id;
	private String text;
	private Long kettleObjectId;
	private String nodeType;
	private String auditStatus;
	private String interfaceType;
	private boolean hasChildren;
	private Collection<TreeNode> children;
	private String ifIds;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public Long getKettleObjectId() {
		return kettleObjectId;
	}

	public void setKettleObjectId(Long kettleObjectId) {
		this.kettleObjectId = kettleObjectId;
	}
	
	public String getNodeType() {
		return nodeType;
	}

	public void setNodeType(String nodeType) {
		this.nodeType = nodeType;
	}

	public Collection<TreeNode> getChildren() {
		return children;
	}

	public void setChildren(Collection<TreeNode> children) {
		this.children = children;
	}

	@Override
	public boolean equals(Object other) {
		return StringUtils.equals(this.id, ((TreeNode) other).getId());
	}

	@Override
	public int hashCode() {
		return Objects.hashCode(id);
	}


	public String getAuditStatus() {
		return auditStatus;
	}

	public void setAuditStatus(String auditStatus) {
		this.auditStatus = auditStatus;
	}

	public String getInterfaceType() {
		return interfaceType;
	}

	public void setInterfaceType(String interfaceType) {
		this.interfaceType = interfaceType;
	}

	public boolean isHasChildren() {
		if(hasChildren==true){
			return hasChildren;
		}
		if(this.children!=null&&!this.children.isEmpty()){
			return true;
		}
		return false;
	}

	public void setHasChildren(boolean hasChildren) {
		this.hasChildren = hasChildren;
	}

	public String getIfIds() {
		return ifIds;
	}

	public void setIfIds(String ifIds) {
		this.ifIds = ifIds;
	}

	
	
}
